package com.mingqijia.gassafety.authority.vcc.facade;

import com.mingqijia.gassafety.authority.api.web.facade.AuthorityManageFacade;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * 授权管理
 * @author Damon S.
 * @version v0.2
 */
@Api(tags = "控制台--登录2")
@RequestMapping(value = "/console/v1/oauth", produces = MediaType.APPLICATION_JSON_VALUE)
public interface VccAuthorityManageFacade extends AuthorityManageFacade {

    @GetMapping("/token")
    @ApiOperation(value = "生成token", notes = "返回token")
    default String getToken(@RequestParam String code) { return null; }


    @GetMapping("/auth")
    @ApiOperation(value = "跳转认证", notes = "跳转认证")
    void authorize(HttpServletResponse response, HttpServletRequest request) throws IOException;
}
